package com.cn.serverline.lineicp.produce.service.impl;

import cn.hutool.core.bean.BeanUtil;

import com.cn.serverline.lineicp.produce.entity.vo.IpVo;
import com.cn.serverline.lineicp.produce.mapper.LoginIpMapper;

import com.cn.serverline.lineicp.produce.service.LoginIpService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Enumeration;

/**
 *
 * @Author 王烁烁
 * @Date 2024/8/6
 */
@Service
public class LoginIpServiceImpl  implements LoginIpService {
    @Autowired
    private LoginIpMapper loginIpMapper;
    @Override
    public IpVo getLoginIp() throws UnknownHostException {
        InetAddress localHost = InetAddress.getLocalHost();
        String hostAddress = localHost.getHostAddress();
        IpVo ipVo = loginIpMapper.getLoginIp(hostAddress);
        return ipVo;
    }

 
}
